{$layout}

<p class="comment" v-if="files.length == 0">配置内容为configs/目录；暂时还没有备份，每24小时会自动备份一次。<a href="" @click.prevent="backup()">[立即备份]</a> &nbsp; <a href="" @click.prevent="clean()">[清除30天以外的日志]</a></p>

<p class="comment" v-if="files.length > 0">配置内容为configs/目录；每24小时会自动备份一次。<a href="" @click.prevent="backup()">[立即备份]</a> &nbsp; <a href="" @click.prevent="clean()">[清除30天以外的日志]</a></p>

<p class="ui message error" v-if="shouldRestart">
	恢复成功，需要立即重启TeaWeb后有些服务才会生效。
</p>

<table class="ui table selectable" v-if="files.length > 0">
	<thead>
		<tr>
			<th>文件名</th>
			<th>备份时间</th>
			<th>尺寸</th>
			<th class="three op">操作</th>
		</tr>
	</thead>
	<tr v-for="file in files">
		<td>{{file.name}}<br/>
			<p style="font-size:0.8em;color:grey;padding-top:0.2em" v-if="file.isToday">今天</p>
			<p style="font-size:0.8em;color:grey;padding-top:0.2em" v-if="file.isYesterday">昨天</p>
		</td>
		<td>{{file.time}}</td>
		<td>{{file.size}}M</td>
		<td>
			<a :href="'/settings/backup/download?filename=' + file.name" title="下载到本地">下载</a> &nbsp;
			<a href="" title="从此备份恢复" @click.prevent="restore(file.name)" v-if="!isRestoring">恢复</a><span v-if="isRestoring" class="disabled">恢复中</span>
			&nbsp;
			<a href="" @click.prevent="deleteBackup(file.name)">删除</a>
		</td>
	</tr>
</table>

<p class="comment" v-if="files.length > 0">备份的文件在backup目录下。</p>
